<?php 
$dbtype='mysql';
$host='localhost';
$dbname='stu_result';
$username='root';
$password='';
$dsn="{$dbtype}:host={$host};dbname={$dbname}";
try{
	$pdo=new PDO($dsn,$username,$password);
	echo'连接成功';
} catch(PDOException $e){
	die('操作失败'.$e->getMessage());
}